<?php
$act = isset($_GET['act']) ? $_GET['act'] : null;
require 'common.php';
switch ($act) {
	case 'zan'://说说点赞
		$qq = isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey = isset($_GET['skey']) ? $_GET['skey'] : null;
		$pskey = isset($_GET['pskey']) ? $_GET['pskey'] : null;
		$method = isset($_GET['method']) ? $_GET['method'] : 2;
		$sleep = isset($_GET['sleep']) ? $_GET['sleep'] : 0;
		$forbid = isset($_GET['forbid']) ? $_GET['forbid'] : null;
		$runkey = isset($_GET['runkey']) ? $_GET['runkey'] : null;
		if ($qq && $skey && $pskey) {
			$forbid = explode('|', $forbid);
			require_once 'qzone.class.php';
			$qzone = new qzone($qq, $sid, $skey, $pskey);
			$qzone->like($method, $forbid, $sleep);
			foreach ($qzone->msg as $result) {
				echo $result . '<br/>';
			}
			if ($qzone->skeyzt) {
				skeyzt($qq);
			}
			echo '执行时间:' . $date . '';
		} else {
			exit('参数不完整');
		}
	break;
	case 'reply'://说说评论
		$qq = isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey = isset($_GET['skey']) ? $_GET['skey'] : null;
		$pskey = isset($_GET['pskey']) ? $_GET['pskey'] : null;
		$method = isset($_GET['method']) ? $_GET['method'] : 2;
		$content = isset($_GET['content']) ? $_GET['content'] : null;
		$getss = null;
		$sleep = isset($_GET['sleep']) ? $_GET['sleep'] : 0;
		if ($qq && $skey && $pskey) {
			if (preg_match("/\[随机\]/", $content) || $content == '') {
			$str = @file_get_contents('sji.db');
			$content = explode('|', $str);
			} else {
				$content = explode('|', $content);
			}
			require_once 'qzone.class.php';
			$qzone = new qzone($qq, $sid, $skey, $pskey);
			$qzone->reply($method, $content, $sleep);
			foreach ($qzone->msg as $result) {
				echo $result . '<br/>';
			}
			if ($qzone->skeyzt) {
				skeyzt($qq);
			}
		} else {
			echo "参数不完整";
			exit;
		}
	break;
	case 'qunqd'://QQ群签到
		$qq = isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey = isset($_GET['skey']) ? $_GET['skey'] : null;
		$pskey = isset($_GET['pskey']) ? $_GET['pskey'] : null;
		$template = isset($_GET['tuid']) ? $_GET['tuid'] : 2;
		$content = isset($_GET['con']) ? $_GET['con'] : null;
		$forbid = isset($_GET['forbid']) ? $_GET['forbid'] : null;
		$poi = isset($_GET['poi']) ? $_GET['poi'] : null;

		if ($qq && $skey && $pskey) {
			$content = $content ? $content : '签到';
			$forbid = explode(".", $forbid);
			require_once 'qqsign.class.php';
			$qzone = new qqsign($qq, $sid, $skey, $pskey);
			$qzone->qunqd($forbid, $poi, $template, $content);

			//结果输出
			foreach ($qzone->msg as $result) {
				echo $result . '<br/>';
			}
			echo '执行时间:' . $date . '';

			//SKEY失效通知
			if ($qzone->skeyzt) {
				skeyzt($qq);
			}
		} else {
			echo "参数不完整";
			exit;
		}
	break;
	case 'mqq'://手机QQ打卡
		$qq=isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey=isset($_GET['skey']) ? $_GET['skey'] : null;

		if($qq && $skey){}else{echo"参数不完整";exit;}

		require_once 'qqsign.class.php';
		$qzone=new qqsign($qq,$sid,$skey);
		$qzone->checkin();
		$qzone->mqq();

		//结果输出
			foreach($qzone->msg as $result){
				echo $result.'<br/>';
			}
		echo '执行时间:' . $date . '';

		//SKEY失效通知
		if ($qzone->skeyzt) {
			skeyzt($qq);
		}
	break;
	case 'sy'://QQ手游加速
		$qq=isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey=isset($_GET['skey']) ? $_GET['skey'] : null;

		if($qq && $skey){}else{echo"参数不完整";exit;}

		require_once 'qqsign.class.php';
		$qzone=new qqsign($qq,$sid,$skey);
		$qzone->qqgame();

		//结果输出
			foreach($qzone->msg as $result){
				echo $result.'<br/>';
			}
		echo '执行时间:' . $date . '';
	break;
	case 'shuo'://发布说说
		require 'shuo.func.php';
		$qq = isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey = isset($_GET['skey']) ? $_GET['skey'] : null;
		$pskey = isset($_GET['pskey']) ? $_GET['pskey'] : null;
		$nr = isset($_GET['content']) ? $_GET['content'] : null;
		$mode = isset($_GET['mode']) ? $_GET['mode'] : null;
		$tuid = isset($_GET['tuid']) ? $_GET['tuid'] : null;
		$img = isset($_GET['img']) ? $_GET['img'] : null;
		$method = isset($_GET['method']) ? $_GET['method'] : 2;
		$delete = isset($_GET['delete']) ? $_GET['delete'] : null;

		if ($qq && $skey && $pskey) {
		} else {
			echo "参数不完整";
			exit;
		}
		
		switch ($mode) {
			case 1:
				$content = $nr;
				break;
			case 2:
				$content = hitokoto();
				break;
			case 3:
				$content = hitokoto2('g');
				break;
			case 4:
				$content = hitokoto2('f');
				break;
			case 5:
				$content = hitokoto2('d');
				break;
			case 6:
				$content = hitokoto2('e');
				break;
			case 7:
				$content = hitokoto2('a');
				break;
			case 8:
				$content = hitokoto2('c');
				break;
			case 9:
				$content = hitokoto2('b');
				break;
			case 10:
				$content = get_curl('https://api.uomg.com/api/comments.163?format=text');
				break;
		}
		echo '发布说说:  '.$content.'<br>';
		if ($tuid == 2) {
			$imgurl = randimg();
		} else {
			$imgurl = $img;
		}

		include_once "qzone.class.php";
		$qzone = new qzone($qq, $sid, $skey, $pskey);
		$qzone->shuo($method, $content, $imgurl, '', $delete);
		//返回信息
		foreach ($qzone->msg as $result) {
			echo $result . '<br/>';
		}
		echo '执行时间:' . $date . '';

		//SKEY失效通知
		if ($qzone->skeyzt) {
			skeyzt($qq);
		}
	break;
	case 'zf'://转发说说
		$qq=isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey=isset($_GET['skey']) ? $_GET['skey'] : null;
		$pskey=isset($_GET['pskey']) ? $_GET['pskey'] : null;
		$uins=isset($_GET['uin']) ? $_GET['uin'] : null;
		$content=isset($_GET['nr']) ? $_GET['nr'] : null;

		$method=isset($_GET['method']) ? $_GET['method'] : 3;
		$getss=null;
		if($qq && $skey && $pskey){}else{echo"参数不完整";exit;}

		$uins=explode('|',$uins);

		require_once 'qzone.class.php';
		$qzone=new qzone($qq,$sid,$skey,$pskey);
		$qzone->zhuanfa($method,$uins,$content);

		//结果输出
			foreach($qzone->msg as $result){
				echo $result.'<br/>';
			}
		echo '执行时间: ' . $date . '';

		//SKEY失效通知
		if ($qzone->skeyzt) {
			skeyzt($qq);
		}
	break;
	case 'del'://删除说说
		$qq = isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey = isset($_GET['skey']) ? $_GET['skey'] : null;
		$pskey = isset($_GET['pskey']) ? $_GET['pskey'] : null;

		$method = isset($_GET['method']) ? $_GET['method'] : 2;

		if ($qq && $skey && $pskey) {
		} else {
			echo "参数不完整";
			exit;
		}


		require_once 'qzone.class.php';
		$qzone = new qzone($qq, $sid, $skey, $pskey);
		$qzone->shuodel($method);

		foreach ($qzone->msg as $result) {
			echo $result . '<br/>';
		}

		echo '执行时间: ' . $date . '';

		//SKEY失效通知
		if ($qzone->skeyzt) {
			skeyzt($qq);
		}
	break;
	case 'delly'://删除留言
		$qq = isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey = isset($_GET['skey']) ? $_GET['skey'] : null;
		$pskey = isset($_GET['pskey']) ? $_GET['pskey'] : null;
		$method = isset($_GET['method']) ? $_GET['method'] : 2;

		if ($qq && $skey && $pskey) {
		} else {
			echo "参数不完整";
			exit;
		}


		require_once 'qzone.class.php';
		$qzone = new qzone($qq, $sid, $skey, $pskey);
		$qzone->delly();

		//结果输出
		foreach ($qzone->msg as $result) {
			echo $result . '<br/>';
		}

		echo '执行时间: ' . $date . '';

		//SKEY失效通知
		if ($qzone->skeyzt) {
			skeyzt($qq);
		}
	break;
	case 'ht'://花藤代养
		$qq = isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey = isset($_GET['skey']) ? $_GET['skey'] : null;
		$pskey = isset($_GET['pskey']) ? $_GET['pskey'] : null;

		if ($qq && $skey && $pskey) {
		} else {
			echo "参数不完整";
			exit;
		}

		require_once 'qzone.class.php';
		$qzone = new qzone($qq, $sid, $skey, $pskey);
		$qzone->flower();

		//结果输出
		foreach ($qzone->msg as $result) {
			echo $result . '<br/>';
		}
		echo '执行时间: ' . $date . '';
		//SKEY失效通知
		if ($qzone->skeyzt) {
			skeyzt($qq);
		}
	break;
	case 'ql'://情侣空间签到
		$qq = isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey = isset($_GET['skey']) ? $_GET['skey'] : null;
		$content = isset($_GET['mode']) ? $_GET['mode'] : null;

		if ($qq && $skey) {
		} else {
			echo "参数不完整";
			exit;
		}

		require_once 'qqsign.class.php';
		$qzone = new qqsign($qq, $sid, $skey);
		$qzone->sweet_send($content);

		//结果输出
		foreach ($qzone->msg as $result) {
			echo $result . '<br/>';
		}
		echo '执行时间: ' . $date . '';

		//SKEY失效通知
		if ($qzone->skeyzt) {
			skeyzt($qq);
		}
	break;
	case 'qd'://QQ空间签到
		require 'shuo.func.php';
		$qq = isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey = isset($_GET['skey']) ? $_GET['skey'] : null;
		$pskey = isset($_GET['pskey']) ? $_GET['pskey'] : null;

		$method = isset($_GET['method']) ? $_GET['method'] : 2;
		$content = isset($_GET['content']) ? $_GET['content'] : null;


		if ($qq && $skey && $pskey) {
		} else {
			echo "参数不完整";
			exit;
		}


		if ($content == null) {
			$content = hitokoto();
		}

		require_once 'qzone.class.php';
		$qzone = new qzone($qq, $sid, $skey, $pskey);
		$qzone->qiandao($method, $content);

		//结果输出
		foreach ($qzone->msg as $result) {
			echo $result . '<br/>';
		}
		echo '执行时间: '.$date.'';

		//SKEY失效通知
		if ($qzone->skeyzt) {
			skeyzt($qq);
		}
	break;
	case 'hyqd'://QQ会员签到
		$qq=isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey=isset($_GET['skey']) ? $_GET['skey'] : null;
		if($qq && $skey){}else{echo"参数不完整";exit;}

		require_once 'qqsign.class.php';
		$qzone=new qqsign($qq,$sid,$skey);
		$qzone->vipqd();

		//结果输出
			foreach($qzone->msg as $result){
				echo $result.'<br/>';
			}
		echo '执行时间: '.$date.'';

		//SKEY失效通知
		if ($qzone->skeyzt) {
			skeyzt($qq);
		}
	break;
	case 'hzqd'://黄钻签到
		$qq=isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey=isset($_GET['skey']) ? $_GET['skey'] : null;
		$pskey=isset($_GET['pskey']) ? $_GET['pskey'] : null;

		if($qq && $skey && $pskey){}else{echo"参数错误";exit;}


		require_once 'qqsign.class.php';
		$qzone=new qqsign($qq,$sid,$skey,$pskey);
		$qzone->yqd();

		//结果输出
			foreach($qzone->msg as $result){
				echo $result.'<br/>';
			}
		echo '执行时间: '.$date.'';

		//SKEY失效通知
		if ($qzone->skeyzt) {
			skeyzt($qq);
		}
	break;
	case 'hlwqd'://好莱坞会员签到
		$qq=isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey=isset($_GET['skey']) ? $_GET['skey'] : null;

		if($qq && $skey){}else{echo"参数不完整";exit;}

		require_once 'qqsign.class.php';
		$qzone=new qqsign($qq,$sid,$skey);
		$qzone->video();

		//结果输出
			foreach($qzone->msg as $result){
				echo $result.'<br/>';
			}

		//SKEY失效通知
		if ($qzone->skeyzt) {
			skeyzt($qq);
		}
	break;
	case 'dhyqd'://QQ大会员签到
		$qq=isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey=isset($_GET['skey']) ? $_GET['skey'] : null;
		$pskey=isset($_GET['pskey']) ? $_GET['pskey'] : null;

		if($qq && $skey && $pskey){}else{echo"参数不完整";exit;}

		require_once 'qqsign.class.php';
		$qzone=new qqsign($qq,$sid,$skey,$pskey);
		$qzone->bigvip();

		//结果输出
		foreach($qzone->msg as $result){
			echo $result.'<br/>';
		}

		//SKEY失效通知
		if ($qzone->skeyzt) {
			skeyzt($qq);
		}
	break;
	case 'wsqd'://微视签到
		$qq=isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey=isset($_GET['skey']) ? $_GET['skey'] : null;
		$pskey=isset($_GET['pskey']) ? $_GET['pskey'] : null;

		if($qq && $skey && $pskey){}else{echo"参数不完整";exit;}

		require_once 'qqsign.class.php';
		$qzone=new qqsign($qq,$sid,$skey,$pskey);
		$qzone->weishi();

		//结果输出
		foreach($qzone->msg as $result){
			echo $result.'<br/>';
		}

		//SKEY失效通知
		if ($qzone->skeyzt) {
			skeyzt($qq);
		}
	break;
	case 'renqi'://空间人气
		$maxnum = 10; //每QQ最大刷人气次数
		$qq = isset($_GET['qq']) ? $_GET['qq'] : null;
		if ($qq) {
		} else {
			echo "参数不完整";
			exit;
		}
		require_once 'qzone.class.php';
		$count = qzone::get_renqi($qq);
		if ($count === false) {
			echo '请设置所有人可以访问你的空间';
			exit;
		} elseif ($count > $maxnum) {
			echo '你的QQ空间人气已达到10个,请明天再来';
			exit;
		}
		$result = $pdo->query("select * from `zy_qqs` where cookiezt=0 order by rand() limit 5");
		while ($row = $result->fetch()) {
			$qzone = new qzone($row['qq'], $row['sid'], $row['skey'], $row['pskey']);
			$qzone->visitqzone($qq);
			echo $qzone->msg[0] . '<br/>';
		}
		echo '执行时间: '.$date.'';
	break;
	case 'wyqd'://网易云音乐签到
		$username = isset($_GET['username']) ? $_GET['username'] : null;
		$password = isset($_GET['password']) ? $_GET['password'] : null;
		if($username && $password){}else{echo"参数不完整";exit;}
		require_once '163music.class.php';
		$api = new API();

		$data = $api->login($username,$password);
		$arr = json_decode($data,true);
		if(array_key_exists('code',$arr) && $arr['code']==200) {
			$token = $arr['token'];
			$cookie = 'MUSIC_U='.$token;
			$result = $api->sign($cookie);
			$arr = json_decode($result,true);
			if(array_key_exists('code',$arr) && $arr['code']==200) {
				echo '签到成功！经验+'.$arr['point'];
			}elseif($arr['code']==-2) {
				echo '今天已经签到过了，请明天再来！';
			}else{
				echo '签到失败，原因：'.$arr['msg'];
			}
		}elseif(array_key_exists('msg',$arr)){
			echo '登录失败，原因：'.$arr['msg'];
		}else{
			echo '登录失败，原因未知';
		}
	break;
	case 'yundong'://QQ运动打卡
		$qq=isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey=isset($_GET['skey']) ? $_GET['skey'] : null;

		if($qq && $skey){}else{echo"<font color='red'>输入不完整!<a href='javascript:history.back();'>返回重新填写</a></font>";exit;}

		require_once 'qqsign.class.php';
		$qqsign=new qqsign($qq,$sid,$skey);
		$qqsign->yundong();

		//结果输出
		foreach($qqsign->msg as $result){
			echo $result.'<br/>';
		}
	break;
	case 'hzmp'://QQ名片互赞
		$qq=isset($_GET['qq']) ? $_GET['qq'] : null;
		$skey=isset($_GET['skey']) ? $_GET['skey'] : null;
		$pskey=isset($_GET['pskey']) ? $_GET['pskey'] : null;
		$maxnum = 1000; //每QQ最大点赞次数
		if ($qq && $pskey) {
		} else {
			echo "参数不完整";
			exit;
		}
		require_once 'qqsign.class.php';
		$qqsign=new qqsign($qq,$sid,$skey,$pskey);
		$count = $qqsign->get_mpznum($qq);
		$count = $count['visit']['twoReqDiffLikeNum'];
		if ($count > $maxnum) {
			echo '你今天已经被赞'.$count.'次了,请明天再来';
			exit;
		}
		echo '今日已经获得'.$count.'次点赞<br>';
		$result = $pdo->query("select * from `zy_qqs` where cookiezt=0 order by rand() limit 10");
		while ($row = $result->fetch()) {
			if($row['qq']!=$qq){
				$qqsign=new qqsign($row['qq'],$row['sid'],$row['skey'],$row['pskey'],1);
				$qqsign->mpdz($qq);
				echo $qqsign->msg[0] . '<br/>';
			}
		}
		echo '执行时间: '.$date.'';
	break;
	default:
	exit('What are you doing?');
}